package com.yy.ttmodule.udp;


import android.os.SystemClock;
import android.support.annotation.NonNull;

public final class UdpTxDataTask implements Runnable {
    private final String TAG = "UdpTxDataTask";

    protected long waitTime = 70;
    private UdpTxData txData;

    protected UdpTxDataTask(@NonNull UdpTxData udpTxData) {
        txData = udpTxData;
    }

    @Override
    public void run() {
        try {
            while (UdpServer.isSendData) {
                //需要一直发送的数据包,不需要执行重发机制
                txData.sendPackage();
                SystemClock.sleep(waitTime);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
